home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 9.3 KB | 353 lines | [TEXT/MPS ] |
- ;
- ; File: CoachMarks.a
- ;
- ; Contains: Public CoachMark programming interface.
- ;
- ; Version: Technology: Copland
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__COACHMARKS__') = 'UNDEFINED' THEN
- __COACHMARKS__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
- include 'Sound.a'
- ENDIF
- IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
- include 'Windows.a'
- ENDIF
- IF &TYPE('__HIWINDOWTYPES__') = 'UNDEFINED' THEN
- include 'HIWindowTypes.a'
- ENDIF
- IF FOR_SYSTEM8_COOPERATIVE THEN
- ;
- ; Attributes —————————————————————————————————————————————————————————————————————————————————————————————
- ; animation speeds
- ;
-
- kCoachMarkFastest EQU 0
- kCoachMarkSlowest EQU 31
- ; sloppiness
-
- kPerfectCoachMark EQU 0
- kSloppyCoachMark EQU 100
- ; translucency
-
- kMaxCoachMarkWeight EQU 100
- kDefaultCoachMarkRegularWeight EQU 75
- kDefaultCoachMarkHiddenWeight EQU 25
- ; stroke width
-
- kDefaultCircleCoachMarkThickness EQU 12
- kDefaultUnderlineCoachMarkThickness EQU 8
- kDefaultXCoachMarkThickness EQU 15
- kDefaultArrowCoachMarkThickness EQU 7
- kDefaultHighlighterCoachMarkThickness EQU 5
- ; Selectors ———————————————————————————————————————————————————————————————————————————————————————————————
-
- kCircleCoachMark EQU 1
- kUnderlineCoachMark EQU 2
- kXCoachMark EQU 3
- kArrowCoachMark EQU 4
- kHighlighterCoachMark EQU 5
- kNumCoachMarkTypes EQU 5
- ; typedef UInt32 CoachMarkType
-
-
- kCoachMarkStraight EQU 0
- kCoachMarkCurvesUp EQU 1
- kCoachMarkCurvesDown EQU 2
- ; typedef UInt32 CoachMarkCurvature
-
- ;
- ; Flags ———————————————————————————————————————————————————————————————————————————————————————————————————
- ; theme element inheritance flags -- is "heritage" and "inherit" too wordy? Could use a scheme based on the word "trait"
- ;
-
- kCoachOverrideThemeNothing EQU 0
- kCoachOverrideThemeColor EQU $01
- kCoachOverrideThemeOpacity EQU $02
- kCoachOverrideThemeSloppiness EQU $04
- kCoachOverrideThemeStrokeWidth EQU $08
- kCoachOverrideAllThemeTraits EQU $FFFFFFFF
- ; typedef UInt32 CoachThemeOverrideFlags
-
-
- kCoachMarkDefaultAnimation EQU 0
- ; typedef UInt32 CoachAnimationType
-
- ;
- ; In which direction should the animation go? For an arrow or underline
- ; this is inherent in the geometry. For the others, some bit flags:
- ;
-
- kCoachMarkDefaultDirection EQU 0 ; for circle:
- kCoachMarkClockwise EQU $0000
- kCoachMarkCounterClockwise EQU $0001 ; X stroke direction:
- kCoachMarkTopLeftToBottomRightMask EQU $0000
- kCoachMarkBottomRightToTopLeftMask EQU $0004 ; X stroke direction:
- kCoachMarkTopRightToBottomLeftMask EQU $0000
- kCoachMarkBottomLeftToTopRightMask EQU $0008 ; which X stroke is first:
- kCoachMarkTopLeftToBottomRightFirstMask EQU $0000
- kCoachMarkTopRightToBottomLeftFirstMask EQU $0010
- ; typedef UInt32 CoachDirection
-
- ; to specify how to erase a coach mark
-
- kCoachMarkDefaultErase EQU 0
- ; typedef UInt32 CoachMarkEraseOptions
-
- ;
- ; Structures —————————————————————————————————————————————————————————————————————————————————————————
- ; opaque reference to a coach mark
- ;
-
-
- ; CoachMarkRec specifies the appearance of a CoachMark
- CoachMarkRec RECORD 0
- markType ds.l 1 ; offset: $0 (0) ; which shape of mark?
- themeOverrides ds.l 1 ; offset: $4 (4) ; which values do we get from the theme?
- color ds RGBColor ; offset: $8 (8) ; what color shall the CoachMark be?
- sound ds.l 1 ; offset: $E (14) ; sound to be played upon drawing the coachmark (••• Doesn’t work in D11)
- regularPercentage ds.w 1 ; offset: $12 (18) ; 0..100 - opacity as drawn within the specified grafport
- hiddenPercentage ds.w 1 ; offset: $14 (20) ; 0..100 - opacity as drawn outside the specified grafport
- sloppiness ds.w 1 ; offset: $16 (22) ; 0..100
- thickness ds.w 1 ; offset: $18 (24) ; in pixels
- curvature ds.l 1 ; offset: $1A (26) ; direction of bulge for line-like marks
- sizeof EQU * ; size: $1E (30)
- ENDR
- ; CoachMarkAnimation specifies the appearance of a coach mark's animation
- CoachMarkAnimation RECORD 0
- effectType ds.l 1 ; offset: $0 (0)
- speed ds.l 1 ; offset: $4 (4)
- direction ds.l 1 ; offset: $8 (8)
- sizeof EQU * ; size: $C (12)
- ENDR
- ;
- ; The Freaky Good Stuff ———————————————————————————————————————————————————————————————————————————————
- ; Creation/destruction
- ;
- ;
- ; extern OSStatus NewCoachMarkRef(const CoachMarkRec *appearance, CoachMarkRef *newCoachMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION NewCoachMarkRef
- ENDIF
-
- ;
- ; extern OSStatus GetNewCoachMarkRef(SInt16 resID, CoachMarkRef *newMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetNewCoachMarkRef
- ENDIF
-
- ;
- ; extern OSStatus DisposeCoachMark(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION DisposeCoachMark
- ENDIF
-
- ; To specify geometry
- ;
- ; extern OSStatus CoachRectOnWindow(CoachMarkRef mark, HIWindow *window, const Rect *localRect)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CoachRectOnWindow
- ENDIF
-
- ;
- ; extern OSStatus CoachGlobalRect(CoachMarkRef mark, const Rect *globalRect)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CoachGlobalRect
- ENDIF
-
- ;
- ; extern OSStatus CoachStrokeOnWindow(CoachMarkRef theMark, HIWindow *window, const Point *localSource, const Point *localDest)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CoachStrokeOnWindow
- ENDIF
-
- ;
- ; extern OSStatus CoachGlobalStroke(CoachMarkRef theMark, const Point *globalSource, const Point *globalDest)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CoachGlobalStroke
- ENDIF
-
- ; Accessors
- ;
- ; extern CoachMarkType GetCoachMarkType(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkType
- ENDIF
-
- ;
- ; extern HIWindow *GetCoachMarkWindow(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkWindow
- ENDIF
-
- ;
- ; extern OSStatus GetCoachMarkRect(CoachMarkRef mark, Rect *globalRect)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkRect
- ENDIF
-
- ;
- ; extern OSStatus GetCoachMarkStroke(CoachMarkRef theMark, Point *globalSource, Point *globalDest)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkStroke
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkColor(CoachMarkRef theMark, const RGBColor *color)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkColor
- ENDIF
-
- ;
- ; extern OSStatus GetCoachMarkColor(CoachMarkRef theMark, RGBColor *color)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkColor
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkRegularWeight(CoachMarkRef theMark, UInt16 weight)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkRegularWeight
- ENDIF
-
- ;
- ; extern UInt16 GetCoachMarkRegularWeight(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkRegularWeight
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkHiddenWeight(CoachMarkRef theMark, UInt16 weight)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkHiddenWeight
- ENDIF
-
- ;
- ; extern UInt16 GetCoachMarkHiddenWeight(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkHiddenWeight
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkThickness(CoachMarkRef theMark, UInt16 thickness)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkThickness
- ENDIF
-
- ;
- ; extern UInt16 GetCoachMarkThickness(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkThickness
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkSloppiness(CoachMarkRef theMark, UInt16 sloppiness)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkSloppiness
- ENDIF
-
- ;
- ; extern UInt16 GetCoachMarkSloppiness(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkSloppiness
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkCurvature(CoachMarkRef theMark, CoachMarkCurvature curvature)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkCurvature
- ENDIF
-
- ;
- ; extern CoachMarkCurvature GetCoachMarkCurvature(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkCurvature
- ENDIF
-
- ;
- ; extern OSStatus SetCoachMarkThemeOverrides(CoachMarkRef theMark, CoachThemeOverrideFlags inHeritage)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetCoachMarkThemeOverrides
- ENDIF
-
- ;
- ; extern OSStatus GetCoachMarkThemeOverrides(CoachMarkRef theMark, CoachThemeOverrideFlags *outHeritage)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetCoachMarkThemeOverrides
- ENDIF
-
- ;
- ; Drawing, animation, erasing
- ; CoachMarkInteraction is synchronous and applies globallly, the other three are not and require windows
- ;
- ;
- ; extern OSStatus CoachMarkInteraction(CoachMarkRef theMark, const CoachMarkAnimation *effect)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CoachMarkInteraction
- ENDIF
-
- ;
- ; extern OSStatus AnimateCoachMark(CoachMarkRef theMark, const CoachMarkAnimation *effect)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION AnimateCoachMark
- ENDIF
-
- ;
- ; extern OSStatus DrawCoachMark(CoachMarkRef theMark)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION DrawCoachMark
- ENDIF
-
- ;
- ; extern OSStatus EraseCoachMark(CoachMarkRef theMark, CoachMarkEraseOptions options)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION EraseCoachMark
- ENDIF
-
- ENDIF
- ENDIF ; __COACHMARKS__
-
-